<?php
class SLS_BoProductionDeployment extends SLS_BoControllerProtected 
{
	
	public function action()
	{
		$user 	= $this->hasAuthorative();
		$xml 	= $this->getXML();
		$xml	= $this->makeMenu($xml);
		$prodFiles = array ("site" 		=> false,
							"db" 		=> false,
							"mail" 		=> false,
							"project" 	=> false);
		foreach($prodFiles as $prodFile => $exists)
			$prodFiles[$prodFile] = file_exists($this->_generic->getPathConfig("configSecure").$prodFile."_prod.xml");
			
		$xml->startTag("prod_files");
		foreach($prodFiles as $prodFile => $exists)
		{
			$action = "";
			switch($prodFile)
			{
				case "site": 	$action = "GlobalSettings"; 	break;
				case "db": 		$action = "DataBaseSettings"; 	break;
				case "mail": 	$action = "MailSettings"; 		break;
				case "project": $action = "ProjectSettings"; 	break;
			}
			$xml->startTag("prod_file");
				$xml->addFullTag("title",$prodFile."_prod.xml",true);
				$xml->addFullTag("exists",($exists) ? "true" : "false",true);
				$xml->addFullTag("url_edit",$this->_generic->getFullPath("SLS_Bo",$action,array(array("key"=>"ProdDeployment","value"=>"true"))),true);
			$xml->endTag("prod_file");
		}
		$xml->endTag("prod_files");
		
		$xml->addFullTag("url_batch",$this->_generic->getFullPath("SLS_Bo","GlobalSettings",array(array("key"=>"ProdDeployment","value"=>"true"),array("key"=>"CompleteBatch","value"=>"true"))),true);
		
		$this->saveXML($xml);		
	}
	
}
?>